package com.lmaye.design.patterns.creation.bulider;

/**
 * -- 指挥者
 *
 * @author lmay.Zhou
 * @date 2020/11/16 23:29 星期一
 * @qq 379839355
 * @email lmay@lmaye.com
 * @since JDK1.8
 */
public class HouseDirector {
    private HouseBuilder houseBuilder;

    public HouseDirector(HouseBuilder houseBuilder) {
        this.houseBuilder = houseBuilder;
    }

    /**
     * 构建
     *
     * @return House
     */
    public House construct() {
        houseBuilder.buildBase();
        houseBuilder.buildWall();
        houseBuilder.buildRoof();
        return houseBuilder.buildHouse();
    }
}
